﻿using System.Windows.Forms;
using GeoSketch2.Core;

namespace GeoSketch2.Archaeo
{
    /// <summary>
    /// The toolbar button to display the whole excavationarea
    /// </summary>
    public partial class TBBGlobalZoom : BaseToolbarButton
    {
        #region Constructor
        /// <summary>
        /// The toolbar button to display the whole excavationarea
        /// </summary>
        public TBBGlobalZoom()
        {
            InitializeComponent();
            ToolTipText = "Global zoom";
        }
        #endregion

        #region Events
        /// <summary>
        /// The event on the mouse click on the button
        /// </summary>
        protected override void OnMouseClick(object sender, MouseEventArgs e)
        {
            ((DisplayBox)this.DisplayBox).Viewport.CurrentObjectView = ((DisplayBox)this.DisplayBox).Viewport.CurrentExcavationArea.Bounds.GetRectangleDBounds(YAxisDirection.UpSide);

            this.DisplayBox.Refresh();
        }
        #endregion
    }
}
